The Multi Protocol Label Switching (MPLS) protocol is a special forwarding mechanism, which assigns labels to Internet Protocol (IP) packets accessing a network, and implements the forwarding of the IP packets through label switching. The labels function as substitutes of IP packet headers in the network. In the network, the MPLS forwards the IP packets through the labels (instead of the IP packet headers) in the paths of the IP packets. When the IP packets exit the MPLS network, the packets are decapsulated, and are routed to the destination according to the routing modes of the IP packets.
Referring to FIG. 1, nodes at the edge of the MPLS network are label edge routers (LERs), and nodes at the center of the MPLS network are label switching routers (LSRs). Paths between the nodes in the MPLS network are label switched paths (LSPs). An LSP may be considered as a unidirectional tunnel through the MPLS network. An LSP carries relevant routing and topological information.
The system architecture of the MPLS includes a control plane and a forwarding plane. The control plane is configured to generate a label information base according to an LSP, and transfer control information to a label forwarding information base on the forwarding plane for guiding label forwarding.
In the conventional art, when a router controls a GR, an MPLS forwarding maintenance timer is started. An interval of the timer may be configured by a user. Before the timer expires, the forwarding plane reserves label switching information before the GR is controlled, and the control plane recovers the label information. After the timer expires, the control plane exits the GR state, and in the case that some label information is not recovered, the forwarding plane deletes such information. In addition, if all the label information is recovered before the timer expires, the GR time is not shortened.
During the implementation of the present invention, the inventors find that the conventional art has at least the following problem: The MPLS forwarding maintenance timer is configured to control the time of the GR; however, before the LSRs are recovered and restarted, the time required by all the LSPs is not only related to the number of LSPs, but also closely to the elements such as processing speed, network state, and topological environment. In actual applications, it is possible that the LSPs are not completely recovered after the timer expires, or the LSPs are completely recovered before the timer expires. In the former situation, the routers exit the GR state because the timer expires, while a part of the LSPs are not recovered, thus the unrecovered label information is deleted. This situation results in traffic interruption. In the latter situation, the routers do not exit the GR state after all the LSPs are recovered, thus the recovery time for the routers to recover is affected, and some normal functions of the routers may not be enabled because the routers are in the GR. For example, the routers do not respond to all events such as route changes and configuration changes. Therefore, the situation causes that the timer cannot precisely sense whether all the LSPs are recovered and thus the routers cannot exit a GR state in time after all the LSPs are recovered. As a result, some normal functions of the routers cannot be realized, and the reliability of the routers is lowered.